#include "httpimpl.h"
#include "httptimpl.h"

CHttpImpl::CHttpImpl(void)
{

}
CHttpImpl::~CHttpImpl(void)
{

}
//////////////////////////////////////////////////////////////////////////
std_method_impl CHttpImpl::init_class(IBase* prot, IBase* punkOuter)
{
	HRESULT		hr = S_OK;
	if (prot != NULL)
	{
		m_pRot = prot;
	}
	return hr;
}
std_method_impl CHttpImpl::Init(void*)
{
	HRESULT		hr = S_OK;

	return hr;
}
std_method_impl CHttpImpl::Uninit()
{
	HRESULT		hr = S_OK;

	return hr;
}
std_method_impl CHttpImpl::Start()
{
	HRESULT		hr = S_OK;

	m_pRot->GetObject(CLSID_IAsynFrame, _uuidof(IAsynIo), (IBase**)&m_pIAsynIo.m_p);
	retrtpv(m_pIAsynIo, E_FAIL)


	m_pRot->GetObject(CLSID_IAsynFrame, _uuidof(IAsynFrame), (IBase**)&m_pIAsynFrame.m_p);
	retrtpv(m_pIAsynFrame, E_FAIL)


	m_pRot->GetObject(CLSID_IDns, _uuidof(IDns), (IBase**)&m_pIDns.m_p);
	retrtpv(m_pIDns, E_FAIL)

	return hr;
}
std_method_impl CHttpImpl::Stop()
{
	HRESULT		hr = S_OK;


	return hr;
}
std_method_impl CHttpImpl::CreateHttp_t(IBase **pBase)
{
	HRESULT		hr = S_OK;


	CHttptImpl* pObject						= NULL;
	pObject = new CHttptImpl();
	hr = pObject->QueryInterface(_uuidof(IHttp_t), (void**)pBase);

	_lComPtr<IAsyncTcpSocket>			pIAsyncTcpSocket;
	hr = m_pIAsynIo->CreateAsyncTcpSocket((IBase**)&pIAsyncTcpSocket.m_p);

	_lComPtr<IIoOperation>				pIOper;
	hr = m_pIAsynFrame->CreateAsynIoOperation(&pIOper.m_p, pObject);

	pObject->BindHttp(pIAsyncTcpSocket, pIOper, m_pIDns);


	return hr;
}
std_method_impl CHttpImpl::CreateHttp_s(IBase **pBase)
{
	HRESULT		hr = S_OK;
	return hr;
}


